<template>
  <view class="live_item" @click="clickItem">
    <view class="left_warp">
      <image :src="item.coverUrl" />
      <view class="time_warp">{{ item.startTime }}</view>
    </view>
    <view class="right_warp">
      <view class="right_title">{{ item.name }}</view>
      <view class="right_bottom_warp">
        <view class="bottom_left">
          <view class="bottom_user_img">
            <image :src="item.teacherIcoUrl" />
          </view>
          <view class="bottom_name">{{ item.teacherName }}</view>
        </view>
        <!-- <view class="bottom_right">
          直播课
        </view> -->
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: "live-card",
  props: {
    item: {
      type: Object,
      value: () => {},
    },
  },
  data() {
    return {};
  },
  methods: {
    clickItem() {
      this.$u.route("/pages/course-detail/course-detail", {
        id: this.item.id,
      });
    },
  },
};
</script>

<style lang="scss">
.live_item {
  width: 690upx;
  height: 230upx;
  background: #ffffff;
  box-shadow: 0px 4upx 6upx #f0f2f5;
  border-radius: 10upx;
  padding: 40upx 20upx;
  margin-bottom: 30upx;
  display: flex;
  justify-content: space-between;
}

.left_warp {
  width: 240upx;
  height: 150upx;
  position: relative;
}

.time_warp {
  position: absolute;
  width: 240upx;
  height: 34upx;
  left: 0;
  bottom: 0;
  background: #000000;
  opacity: 0.7;
  border-radius: 0px 0px 10upx 10upx;
  font-size: 22upx;
  font-weight: 500;
  line-height: 32upx;
  color: #ffffff;
  text-align: center;
}

.right_warp {
  margin-left: 30upx;
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.right_title {
  width: 384upx;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  height: 44upx;
  font-size: 32upx;
  font-weight: bold;
  line-height: 44upx;
}

.right_bottom_warp {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bottom_left {
  display: flex;
  align-items: center;
}

.bottom_user_img {
  width: 50upx;
  height: 50upx;
  border-radius: 50%;
  overflow: hidden;
}

.bottom_name {
  @include no-wrap();

  height: 34upx;
  font-weight: 500;
  line-height: 34upx;
  color: #666666;
  margin-left: 10upx;
}

.bottom_right {
  color: #fff;
  width: 120upx;
  height: 50upx;
  background: linear-gradient(90deg, #f34235 0%, #fe9700 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 25upx;
}
</style>
